# CMake 最低版本号要求
cmake_minimum_required(VERSION 2.8)

# 项目信息
project("CodeCraft-2021")

# 生成debug版本,[Debug, Release]
SET(CMAKE_BUILD_TYPE "Debug")
# 设定开发者,[ZKK, FYB]
SET(DEV_USER "ZKK")

# include路径
include_directories(${PROJECT_SOURCE_DIR}/lib)

# 设置可执行文件生成路径
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/../bin)

if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
    MESSAGE(STATUS "Release Model")
    add_definitions(-DRELEASE)
elseif(${DEV_USER} STREQUAL "ZKK")
    MESSAGE(STATUS "DEV_USER is ${DEV_USER}")
    add_definitions(-DDEV_USER_ZKK)
elseif(${DEV_USER} STREQUAL "FYB")
    MESSAGE(STATUS "DEV_USER is ${DEV_USER}")
    add_definitions(-DDEV_USER_FYB)
else()
    MESSAGE(FATAL_ERROR "ERROR: Unkonw Dev User in Debug Model")
endif()

SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb -std=c++11")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall -std=c++11")

aux_source_directory(${PROJECT_SOURCE_DIR}/lib CPP_SRCS)
MESSAGE(STATUS "CPP_SRCS is ${CPP_SRCS}")
# 指定生成目标

add_executable(CodeCraft-2022 CodeCraft-2022.cpp ${CPP_SRCS})
